import pdf from '@/assets/image/icon_pdf.png';
import upload from '@/assets/image/icon_Upload_small.png';
export const tableData = [
  {
    text: 1,
    textBtn: 'btn1',
    imgBtn: 'imgBtn1',
    select: '1',
    date: '',
    status: '1',
    switch: '1',
    switchImg: '1',
    statusName: 'status1',
    startDate: '2022-09-08',
    endDate: '2022-11-08',
    name: 'Tom',
    level: '1',
    percent: '20',
    categoryNameList: [1, 2, 3, 4, 5, 6],
    address: 'No. 189, Grove St, Los Angeles',
    href: '/data/developer/MCC/Property/Account/ACCOUNTLOANTOTAL/PO202304240001_1684749941976.pdf',
  },
  {
    textBtn: 'btn12',
    imgBtn: 'imgBtn2',
    inputNumber: 77,
    date: '',
    name: 'Tom',
    status: '2',
    switch: '1',
    switchImg: '2',
    statusName: 'status2',
    level: '3',
    percent: '80',
    categoryNameList: ['4', '5', '6'],
    address:
      'No. 189, Grove St, Los AngelesNo. 189, Grove St, Los AngelesNo. 189, Grove St, Los AngelesNo. 189, Grove St, Los Angeles',
  },
  {
    textBtn: 'btn45',
    imgBtn: 'imgBtn3',
    name: 'Tom',
    status: '3',
    switch: '2',
    switchImg: '2',
    statusName: 'status3',
    categoryNameList: ['3 ', '5', '6'],
    level: '1',
    percent: '100',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    textBtn: 'btn97',
    imgBtn: '',
    input: '666',
    date: '',
    status: '1',
    switch: '1',
    switchImg: '2',
    statusName: 'status4',
    name: 'Tom',
    categoryNameList: ['3 ', '4'],
    level: '3',
    percent: '120',
    address: 'No. 189, Grove St, Los Angeles',
  },
];

export const tableList = [
  { type: 'selection' },
  {
    label: 'S/N',
    type: 'index',
  },
  {
    prop: 'opration',
    label: 'Action1',
    itemConfig: {
      width: 80,
      fixed: 'right',
    },
    bindConfig: {
      parentType: 'table',
      valueType: 'fixed',
      fixedValue: 'Delete',
      trigger: 'hover',
    },
  },
  {
    prop: 'attachList',
    label: '批量附件',
    component: 'viewFileList',
    itemConfig: {
      width: '100',
    },
    bindConfig: {},
  },
  {
    prop: 'text',
    label: '文本1',
    component: 'tagList',
    itemConfig: {
      width: '100',
    },
    bindConfig: {
      options: [
        {
          label: 'Disabled',
          value: '1',
        },
        {
          label: 'Enabled',
          value: '2',
        },
      ],
    },
  },
  {
    prop: 'textBtn',
    label: '文本点击',
    component: 'tableMultipleTag',
    itemConfig: {
      width: '200',
      align: 'left',
      headerAlign: 'center',
    },
    bindConfig: {
      title: '文本点击',
      options: {
        using: { type: '' },
        id: { type: 'warning' },
        text: { style: { backgroundColor: '#EEF1FF', color: '#536DFE' } },
        haha: { style: { backgroundColor: '#ECE5FF', color: '#B459BB' } },
      },
    },
  },
  {
    prop: 'imgBtn',
    label: '图片点击',
    component: 'imgText',
    itemConfig: {
      width: '100',
    },
    bindConfig: {
      src: pdf,
      emptyShowImg: true,
      imgTextStyle: 'cursor: pointer',
    },
  },
  {
    prop: 'projectid',
    label: '图片固定值+背景色',
    component: 'imgText',
    itemConfig: {
      width: '160',
      // align: 'center',
    },
    bindConfig: {
      src: pdf,
      emptyShowImg: true,
      className: 'marginAuto cursorPointer widthFitContent bgGray',
      valueType: 'fixed',
      fixedValue: '固定值',
    },
  },
  {
    prop: 'imgBtn',
    label: '查看附件',
    component: 'viewFile',
    itemConfig: {
      width: '100',
      align: 'center',
    },
    bindConfig: {
      label: 'View',
      href: 'href',
      viewApi: 'http://183.215.127.149:8070/account/attachmentsFiles/downloadFileReadOnly',
      fileApi: 'xxx',
    },
  },
  {
    prop: 'input',
    label: '输入框',
    component: 'input',
    componentHeader: 'tableHeaderTip',
    itemConfig: {
      width: '160',
      align: 'center',
    },
    headerConfig: {
      headerLabel: 'Tag1',
      tipContentTitle: 'tag1 list',
      tipContentList: [
        { label: '1-1', bStyle: 'background: #fff1ef;' },
        { label: '1-2', bStyle: 'background: #f0f8df' },
        { label: '1-3', bStyle: 'background: #e9f3f9' },
      ],
    },
    bindConfig: {},
  },
  {
    prop: 'statusName',
    label: '状态',
    component: 'status',
    itemConfig: {
      width: '90',
    },
    bindConfig: {
      options: {
        1: { type: 'warning' },
        2: { style: { backgroundColor: '#ECE5FF', color: '#B459BB' } },
        3: { style: { backgroundColor: '#EEF1FF', color: '#536DFE' } },
        4: { style: { backgroundColor: '#ECE5FF', color: '#B459BB' } },
      },
    },
  },
  {
    prop: 'inputNumber',
    label: '数字输入框',
    component: 'inputNumber',
    itemConfig: {
      width: '160',
      align: 'center',
    },
    bindConfig: {},
  },
  {
    prop: 'select',
    label: '选择框',
    component: 'select',
    itemConfig: {
      width: '160',
      align: 'center',
    },
    bindConfig: {
      size: 'small',
      options: [
        {
          label: '123',
          value: '1',
        },
        {
          label: '22',
          value: '2',
        },
      ],
    },
  },
  {
    prop: 'select',
    label: '接口选择框',
    component: 'select',
    itemConfig: {
      width: '160',
      align: 'center',
    },
    bindConfig: {
      size: 'small',
      options: [],
      filters: { label: 'dictName', value: 'dictCode' },
    },
  },
  {
    prop: 'date',
    label: 'Date',
    component: 'date',
    itemConfig: {
      width: '200',
    },
    bindConfig: {
      clearable: true,
      type: 'daterange',
      unlinkPanels: true,
      rangeSeparator: 'To',
      format: 'DD/MM/YYYY',
      valueFormat: 'YYYY-MM-DD',
      style: { width: '100%' },
      size: 'small',
      startKey: 'startDate',
      endKey: 'endDate',
    },
  },

  {
    prop: 'switch',
    label: 'Switch',
    component: 'switchBase',
    itemConfig: {
      width: '90',
    },
    bindConfig: {
      activeValue: '2',
      inactiveValue: '1',
    },
  },
  {
    prop: 'switchImg',
    label: 'Switch Img',
    component: 'switchImg',
    itemConfig: {
      width: '100',
    },
    bindConfig: {
      classNameFn: row => {
        let flag = row?.switchImg !== '1';
        return 'switch_img_' + flag;
      },
    },
  },
  {
    prop: 'upload',
    label: 'upload',
    component: 'uploadLink',
    itemConfig: {
      width: '200',
    },
    bindConfig: {
      accept: 'application/pdf,.pdf',
    },
  },
  {
    prop: 'categoryNameList',
    label: 'Category',
    component: 'tableMultipleTag',
    componentHeader: '',
    itemConfig: {
      sortable: true,
      headerAlign: 'center',
      align: 'left',
      minWidth: 240,
      maxLength: 2,
    },
  },
  {
    prop: 'opration',
    label: '操作',
    component: 'tableImgList',
    itemConfig: {
      headerAlign: 'center',
      align: 'left',
      minWidth: 140,
    },
    bindConfig: {
      imgList: [
        { prop: 'edit', iconClass: 'icon-Tender primary', tip: 'Delete' },
        { prop: 'pdf', src: pdf, tip: 'Pdf' },
        {
          prop: 'upload',
          src: upload,
          tip: 'Upload',
          format: row => {
            return row.status === '1';
          },
        },
      ],
    },
  },
  {
    prop: 'percent',
    label: '%',
    component: 'tableProgress',
    itemConfig: {
      headerAlign: 'center',
      align: 'left',
      width: 240,
      class: 'testeee',
    },
    bindConfig: {
      iconFormat: row => {
        return row?.level === '3' ? [{ src: upload, prop: 'detail', label: 'Detail' }] : [];
      },
    },
  },
];

export const pageConfig = {
  buttonList: [
    {
      label: 'Batch Management',
      prop: 'batchManagement',
      fontClass: 'iconfont icon-edit2',
    },
    {
      label: 'Delete Staff',
      prop: 'delete',
      fontClass: 'iconfont icon-Submit',
    },
    {
      label: 'New',
      prop: 'new',
      fontClass: '',
      type: 'primary',
    },
  ],
  title: '2343444444444444444444444444',
};

export const formList = [
  {
    prop: 'new',
    label: 'New',
    component: 'input',
    bindConfig: {
      prependSlot: 'test',
      appendSlot: 'append',
    },
  },
];

export const importConfig = {
  tableList: [
    {
      label: 'S/N',
      type: 'index',
    },
    {
      prop: 'name',
      label: 'Name',
      component: 'imgText',
      itemConfig: {
        minWidth: '100',
      },
      bindConfig: {},
    },

    {
      prop: 'staffNo',
      label: 'Staff No',
      component: 'tagList',
      itemConfig: {
        minWidth: '100',
      },
      bindConfig: {
        options: {
          1: { type: 'success' },
          2: { style: { backgroundColor: '#f6f6f6', color: 'red' } },
          3: { type: 'danger' },
          4: { type: 'warning' },
        },
      },
    },
    {
      prop: 'email',
      label: 'Email',
      itemConfig: {
        minWidth: '100',
      },
    },
    {
      prop: 'telephone',
      label: 'Telephone',
      itemConfig: {
        minWidth: '100',
      },
    },
    {
      prop: 'attachList',
      label: '批量附件',
      component: 'viewFileList',
      itemConfig: {
        width: '100',
      },
      bindConfig: {},
    },
    {
      prop: 'gender',
      label: 'Gender',
      itemConfig: {
        minWidth: '100',
      },
    },
    {
      prop: 'userId',
      label: 'User Id',
      itemConfig: {
        minWidth: '100',
      },
    },
    {
      prop: 'secondaryName',
      label: 'Role',
      component: 'tableMultipleTag',
      itemConfig: {
        minWidth: '100',
      },
      bindConfig: {
        maxLength: 1,
        title: 'Role',
      },
    },
    {
      prop: 'id',
      label: 'Action1',
      itemConfig: {
        width: 80,
        fixed: 'right',
      },
      bindConfig: {
        parentType: 'table',
        valueType: 'fixed',
        fixedValue: 'Delete',
        trigger: 'hover',
      },
    },
  ],
};
